//
//  ViewController.swift
//  AnJiBei
//
//  Created by 赵鑫 on 15/10/26.
//  Copyright © 2015年 赵鑫. All rights reserved.
//

import UIKit

class ViewController: UIViewController,RequestDelegate {
    
    
    
    @IBOutlet weak var testImageView: UIImageView!

    override func viewDidLoad() {
        super.viewDidLoad()
        
        testJson()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    
    func testJson () {
    
//        var student = people()
//        student.name = "zhaoxin"
//        student.age = 11
//        student.age = 25
//        student.isStudent = true
        
        //var jsonString = D3Json.objectConvertJson(student)
        
       // print(jsonString)
        //var json = Dictionary()
    
        
       // var jsonString = D3Json.objectConvertJson(json)
        
//        let url = Constant.GET_USERINFO_URL
//        
//        let sid = people()
//        sid.sid = "821AC503CDCC7F7820C1D739549AC047"
//        
//        RequestUtils.requestJson(url, parameter: D3Json.objectConvertJson(sid), requestDelegate: self)
//        
        let urls = "http://anjibei.b0.upaiyun.com/calendar/2015/10/22d8f6a3e615e75487a1fb5e56c092ebd0.png"
        
        //RequestUtils.requestImage(urls, imageview: testImageView)
        ImageUntils.downloadImage(urls, imageView: testImageView)
    }
    
    func requestDataNull(message: String) {
        //
        debugPrint(message)
        
    }
    func requestFailure(message: String) {
        //
        debugPrint(message)
        
    }
    func requestTimeOut(message: String) {
        //
        debugPrint(message)
    }
    func requestSuccess(json: AnyObject?, message: String) {
        //
        debugPrint(message)
    }
    
    @IBAction func isWork(sender: UIButton) {
        
        ReachabilityUtils.isConnectedToNetworkDebugPrint()

        PrintUntils.printLog("网络", message: ReachabilityUtils.isConnectedToNetworkOfType())
    }
    
    
}


class people: Reflect {
    var sid:String
    
    required init() {
        sid = "0"
    }
}
